import tkinter

from tkinter import *

from tkinter.filedialog import *

window = tkinter.Tk()
window.title(' Students Information !')
window.geometry('800x600')

# 开头
font_show = ('楷体', 20)
label_show = tkinter.Label(window, text='Welcome to 学生信息操作系统！', font=font_show)
label_show.place(x=200)

def select_all():
    with open('密码.txt','r',encoding='utf8') as file:
        reader = file.read()
        return reader

# 菜单栏
menu_main = tkinter.Menu(window)

# 菜单中下拉栏


menu_operation = tkinter.Menu(menu_main)
menu_find = tkinter.Menu(menu_main)

# menu_find 下拉栏
names = locals()
b = 1
for item in ['select-<1>','select_all-<2>']:
    names['a'+str(b)] =menu_find.add_command(label = item)
    b += 1

menu_main.add_cascade(label = '查看',menu = menu_find)
print(type(names))
print(names)

# menu_operation 下拉栏

for item in ['insert-<3>','remove-<4>','change-<5>']:
    menu_operation.add_command(label = item)
menu_main.add_cascade(label = '编辑',menu = menu_operation)


window['menu'] = menu_main
window.mainloop()